#ifndef THREELEVELCONDITIONDETECT_H
#define THREELEVELCONDITIONDETECT_H

#include"strategyconditionbase.h"
#include <QObject>

class ThreeLevelNormalDetectStrategy : public condtionDectectBase
{
    Q_OBJECT
public:


    // condtionDectectBase interface
public:
    void execute(NormalDetectBase &, SteelInfo *, int);
};



//边部判断
class ThreeLevelBesideDetectStrategy : public condtionDectectBase{
    // condtionDectectBase interface
public:
    void execute(NormalDetectBase &, SteelInfo *, int);
};




//频率判断
class ThreeLevelFrequencyDetectStrategy : public condtionDectectBase{

public:
    void execute(NormalDetectBase &, SteelInfo *, int);

    /**
     * @brief 计算两个缺陷之间的距离
     * @param 缺陷
     * @param 下一个缺陷
     * @return
     */
    double calculateDistance(const ClientDefect& d1, const ClientDefect& d2)const;

    void calculateFrequence(QList<ClientDefect*> list, NormalDetectBase& NormalDetectBaset,SteelInfo *steel,int level,bool isTop);
};



//长度判断:通卷率
class ThreeLevelVerticalLengthDetectStrategy: public condtionDectectBase{

        // condtionDectectBase interface
public:
    void execute(NormalDetectBase &, SteelInfo *, int);


    ///
    /// \brief 将相同的缺陷放入一个容器用于计算
    /// \param NormalDetectBase
    /// \param steel
    /// \param level
    ///
    void GetCounterDefectMap(QList<ClientDefect*>,NormalDetectBase & NormalDetectBase,SteelInfo *steel,int level);

    void CalculateLength(QMap<QString,QList<ClientDefect*>> map,NormalDetectBase & NormalDetectBase,SteelInfo *steel,int lv);

};



//出现直接降级
class ThreeLevelDirectDetectStrategy : public condtionDectectBase{

        // condtionDectectBase interface
public:
    void execute(NormalDetectBase &, SteelInfo *, int);
};


#endif // THREELEVELCONDITIONDETECT_H
